<?php
//关键字查询
class TagAction extends HomeAction {
     
    public function index(){
        $key=M('keyword');
         $keylist=$key->select();
        $this->assign('key_list',$keylist);
       // dump($keylist);
        $this->display('Index:indextag');
    }
    public function keyword_search(){
        //某个文章的关键字搜索
        $key_article=D('KeywordArticleView');
        
        $keydata['keyword_id']=$_GET['keyid'];
        if($_GET['gid']){$keydata['group_id']=$_GET['gid'];}
        $keydata['type']='article';
        
        $articlelist=$key_article->where($keydata)->field('aid,uid,group_id,create_time,uname,name,content,group_name,use_count,useless_count,state')->select();
        //dump($key_article);
       // dump($articlelist);
        $this->assign('article_list',$articlelist);
        $this->display('Group:share_article');
    }
    public function keyarticle(){
       $key_article=D('KeywordArticleView');
        
        $keydata['keyword_id']=$_GET['keyid'];
        
        $keydata['type']='article';
        
        $articlelist=$key_article->where($keydata)->field('aid,uid,group_id,create_time,uname,name,content,group_name,use_count,useless_count,state')->select();
        //dump($key_article);
       // dump($articlelist);
        $this->assign('keyarticle_list',$articlelist);
        $this->assign('keyname',$_GET['kname']);
         $this->display('Index:key_article');
    }
   
}